<!DOCTYPE html>
<html>
<head>
<title>tetete.html</title>

<meta name="keywords" content="keyword1,keyword2,keyword3">
<meta name="description" content="this is my page">
<meta name="content-type" content="text/html; charset=UTF-8">

<style type="text/css">
iframe {
	width: 100%;
	border: none;
}
</style>
</head>

<body>
	<iframe src="top.html" id="top" scrolling="no" height="80px"></iframe> 
	<iframe src="content_index.html" id="content" scrolling="no"
		onload="this.height=this.contentWindow.document.body.scrollHeight"></iframe>

	<iframe src="bottom.html" height="500px" id="bottom" scrolling="no"></iframe>

	<script src="../js/jquery.min.js"></script>
	<script type="text/javascript">
		
		$(function(){
			startInit('content', 560);
			startInit('top', 560); 
		})
	
		var browserVersion = window.navigator.userAgent.toUpperCase();
		var isOpera = false;
		var isFireFox = false;
		var isChrome = false;
		var isSafari = false;
		var isIE = false;
		var iframeTime;
		function reinitIframe(iframeId, minHeight) {
			try {
				var iframe = document.getElementById(iframeId);
				var bHeight = 0;
				if (isChrome == false && isSafari == false)
					bHeight = iframe.contentWindow.document.body.scrollHeight;

				var dHeight = 0;
				if (isFireFox == true)
					dHeight = iframe.contentWindow.document.documentElement.offsetHeight + 2;
				else if (isIE == false && isOpera == false)
					dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
				else
					bHeight += 3;
				var height = Math.max(bHeight, dHeight);
				if (height < minHeight)
					height = minHeight;
				iframe.style.height = height + "px";
			} catch (ex) {
			}
		}
		function startInit(iframeId, minHeight) {
			isOpera = browserVersion.indexOf("OPERA") > -1 ? true : false;
			isFireFox = browserVersion.indexOf("FIREFOX") > -1 ? true : false;
			isChrome = browserVersion.indexOf("CHROME") > -1 ? true : false;
			isSafari = browserVersion.indexOf("SAFARI") > -1 ? true : false;
			if (!!window.ActiveXObject || "ActiveXObject" in window)
				isIE = true;
			reinitIframe(iframeId, minHeight);
			if (iframeTime != null)
				clearInterval(iframeTime)
			iframeTime = window.setInterval("reinitIframe('" + iframeId + "',"
					+ minHeight + ")", 100);
		}
	</script>

</body>
</html>
